#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : zhongxin
# @Time     : 2022/9/1 15:09
# @File     : serializers.py
# @Project  : PyCharm
from rest_framework import serializers
from product.models import Product


class ProductModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = Product
        exclude = ('is_delete',)
        extra_kwargs = {
            'c_time': {
                'read_only': True
            }
        }


class ProductAllModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = Product
        fields = '__all__'
